package com.lh.entity;

import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.groups.Default;
import lombok.Builder;
import lombok.Data;

import java.time.LocalDateTime;
//lombok注解，解决get,set方法生成
@Data
public class Category {
    @NotNull(groups = Update.class)//分组校验
    private Integer id;//主键ID
    @NotEmpty(groups ={Add.class, Update.class} )
    private String categoryName;//分类名称
    @NotEmpty(groups ={Add.class, Update.class} )
    private String categoryAlias;//分类别名
    private Integer createUser;//创建人ID
    private LocalDateTime createTime;//创建时间
    private LocalDateTime updateTime;//更新时间

    //新增校验
    public interface Add extends Default {

    }
    //更新校验
    public interface Update extends Default{

    }


}
